package io.characterStream.bufferedRorW;
/*
缓冲流本身不具备读写功能，只是对普通的流对象做包装
 */
import java.io.*;

public class BufferedStreamDemo1 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("HDay08\\A.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("HDay08\\B.txt"));
        char[] chs = new char[1024];
        int len;
        while((len=br.read(chs))!=-1){
            bw.write(chs,0,len);
        }
        bw.close();
        br.close();

    }

    private static void method1(BufferedReader br, BufferedWriter bw) throws IOException {
        int i;
        while ((i = br.read()) != -1) {
            bw.write((char) i);
        }
        br.close();
        bw.close();
    }
}
